<!-- xuwencheng  2022年6年29日18:00  这是我的wenzhangbianji -->
<!-- 编辑 -->
<template>
  <el-dialog
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    :destory-on-close="true"
    :title="title"
    :visible.sync="dialogFormVisible"
    width="65%"
    @close="close"
  >
    <el-form ref="form" label-width="200px" :model="form" :rules="rules">
      <el-form-item label="分类">
        <!-- 分类 0-举报 1-功能 2-意见 3-申诉 4-其他 -->
        <span v-if="form.relevant == 0">举报</span>
        <span v-if="form.relevant == 1">功能</span>
        <span v-if="form.relevant == 2">意见</span>
        <span v-if="form.relevant == 3">申诉</span>
        <span v-if="form.relevant == 4">其他</span>
      </el-form-item>
      <el-form-item label="反馈内容" prop=" feedbackContent">
        {{ form.feedbackContent }}
      </el-form-item>
      <el-form-item label="联系方式" prop="contactMode">
        {{ form.contactMode }}
      </el-form-item>
      <el-form-item label="创建时间" prop="createTime">
        {{ form.createTime }}
      </el-form-item>
      <el-form-item label="反馈图片">
        <!-- <img class="avatar" disabled :src="form.feedbackPictures" /> -->
        <div v-for="(item, index) in form.feedbackPictures" :key="index">
          <el-image
            :key="index"
            :src="item"
            style="width: 50px; height: 50px"
          />
        </div>
      </el-form-item>

      <!-- <el-form-item label="反馈状态" prop=" feedbackStatus">
        <span v-if="form.feedbackStatus == 0">待处理</span>
        <span v-if="form.feedbackStatus == 1">已处理</span>
      </el-form-item> -->
      <el-form-item label="审核状态" prop="checkValue">
        <el-select v-model="form.feedbackStatus" placeholder="请选择审核状态">
          <el-option
            v-for="item in options5"
            :key="item.id"
            :label="item.creClasName"
            :value="item.id"
            @click.native="optosall(item)"
          />
        </el-select>
      </el-form-item>
      <!-- <el-form-item
        v-if="form.checkValue == 0"
        label="驳回原因"
        prop="rejectReason"
      >
        <el-input v-model="form.rejectReason" placeholder="请输入驳回原因" />
      </el-form-item> -->
    </el-form>
    <el-button class="baocun" size="medium" type="primary" @click="save">
      保存
    </el-button>
  </el-dialog>

  <!-- 增加 -->
</template>

<script>
  /* eslint-disable*/
  import { check } from '@/api/fankui'

  //import { number } from 'echarts'
  export default {
    name: 'search',

    data() {
      return {
        selectedOptions: [],
        token: '',
        imageUrl: '',
        value: true,
        value1: true,
        dialogImageUrl: '',
        dialogVisible: false,
        disabled: false,
        options1: [], //审核状态
        options2: [],
        options3: [],
        options5: [
          {
            id: 1,
            creClasName: '通过',
          },
          {
            id: 0,
            creClasName: '不通过',
          },
        ],
        valueone: '',
        valuetwo: '',
        form: {
          feedbackStatus: '', //0-待处理 1-已处理
        },

        rules: {},
        title: '',
        dialogFormVisible: false,
      }
    },
    created() {},
    methods: {
      showEdit(row) {
        if (!row) {
          this.title = '添加'
        } else {
          this.title = '处理'
          this.form = Object.assign({}, row)
          console.log(this.form)
        }
        this.dialogFormVisible = true
      },
      optosall(e) {
        console.log(this.form.feedbackStatus)
      },
      close() {
        let userId = this.form.userId
        this.$refs['form'].resetFields()
        this.form = this.$options.data().form
        if (!this.form.id) {
          this.form.userId = userId
        }
        console.log(this.form)
        this.dialogFormVisible = false
        this.imageUrl = ''
        // this.form = ''
      },
      save() {
        const msg = check({
          id: this.form.id,
          feedbackStatus: this.form.feedbackStatus,
        })
        msg.then((res) => {
          console.log(res)
          this.$emit('fetch-data')
          this.close()
          msg.then((res) => {
            if (res.msg === '修改成功') {
              this.$baseMessage(res.msg, 'success', 'vab-hey-message-success')
            }
          })
        })
      },

      nickNameChange() {
        this.$forceUpdate()
      },
    },
  }
</script>
<style>
  .avatar-uploader .el-upload {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409eff;
  }
  .avatar-uploader-icon {
    width: 178px;
    height: 178px;
    font-size: 28px;
    line-height: 178px;
    color: #8c939d;
    text-align: center;
  }
  .avatar {
    display: block;
    width: 178px;
    height: 178px;
  }
  .baocun {
    width: 100%;
    height: 100%;
  }
</style>
